package jmine.tec.web.pages.app;

import jmine.tec.environment.db.DBEnvironmentHolder;

import org.springframework.beans.factory.FactoryBean;
import org.springframework.context.ApplicationContext;

import bancosys.tec.utils.db.descriptor.FlatReferenceDatabaseBuilder.ReferenceDatabaseDescriptionType;

/**
 * Contexto de aplicações web para testes.
 * 
 * @author lundberg
 */
public class MockApplicationContext implements FactoryBean {

    /**
     * {@inheritDoc}
     */
    public Object getObject() throws Exception {
        return DBEnvironmentHolder.getInstance().getEnvironment().getHelper().getBeanFactory();
    }

    /**
     * {@inheritDoc}
     */
    public Class getObjectType() {
        return ApplicationContext.class;
    }

    /**
     * {@inheritDoc}
     */
    public boolean isSingleton() {
        return true;
    }

    /**
     * @param spring the spring to set
     */
    public void setSpring(String spring) {
    }

    /**
     * @param refdb the refdb to set
     */
    public void setRefdb(String refdb) {
    }

    /**
     * @param refdbType the refdbType to set
     */
    public void setRefdbType(ReferenceDatabaseDescriptionType refdbType) {
    }
}
